Repository navigation
Migrate APOD archive URLs to science.nasa.gov/apod with backward-compatible malformed URL normalization - #86
oliveratgithub with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: oliveratgithub <[email protected]>
science.nasa.gov/apod with backward-compatible malformed URL normalization
| $new_apod_img_small = str_replace(['https://apod.nasa.gov/apod/http', 'https://science.nasa.gov/apod/http'], 'http', $apod_data['url']); // with fix for malformed url (APOD API issue) | ||
| $new_apod_img_large = str_replace(['https://apod.nasa.gov/apod/http', 'https://science.nasa.gov/apod/http'], 'http', $apod_data['hdurl']); // with fix for malformed url (APOD API issue) |
There was a problem hiding this comment.
@copilot Use The dotENV VAR for the partial part, instead of continuing with a hardcoded full string.
There was a problem hiding this comment.
Implemented in 981d2be: replaced the hardcoded new-domain prefix in the malformed APOD URL normalization with an APOD_SOURCE-derived prefix (APOD_SOURCE . 'http'), while keeping legacy apod.nasa.gov compatibility.
Co-authored-by: oliveratgithub <[email protected]>
oliveratgithub
left a comment
There was a problem hiding this comment.
@copilot looks like the NASA APOD API changes / changed as well: https://api.nasa.gov/assets/files/apod/APOD-APIs-and-RSS-info.pdf
Analyze the specs in the pdf, and propose required code adjustments in the zorg-code, on top of what was already drafted.
I reviewed the updated APOD API docs/migration notes and the current
If you want, I can implement these as a small backward-compatible follow-up commit. |
APOD content links are moving from
apod.nasa.govtoscience.nasa.gov/apod, and existing URL construction/normalization paths needed updating to avoid broken archive/image links during the migration window. This change updates the base source URL and keeps malformed API URL handling compatible with both old and new APOD host patterns.Configuration
NASA_APOD_SOURCEin.env.exampletohttps://science.nasa.gov/apod/.APOD_SOURCEconstant usage remains unchanged and now resolves to the new domain via env config.Runtime APOD URL handling
public/includes/apod.inc.phpto accept both legacy and new APOD prefixes before collapsing to the underlyinghttp...target URL.Documentation/examples
README.mdand inline APOD response comments to the new domain.